package com.aplink.sg.mobilespiff.activities;

import com.aplink.generic.GenericActivity;
import com.aplink.generic.database.DatabaseHelper;
import com.aplink.generic.interfaces.OnControlSubmitListener;
import com.aplink.generic.pojo.controlspec.ControlSpec;
import com.aplink.sg.mobilespiff.R;

public class ProofOfSaleActivity extends GenericActivity implements
		OnControlSubmitListener {

	@Override
	protected int initContentData() {
		return R.raw.proof_of_sale_contentdata;
	}

	@Override
	protected int initFormDesign() {
		return R.raw.proof_of_sale_formdesign;
	}

	@Override
	public void onControlSubmit(ControlSpec controlSpec) {
		if (controlSpec.getIDValue() == R.id.ok_button) {
			String invoiceID = getGenericFragment().getInitValues().getValue(
					"Invoice.InvoiceID");
			DatabaseHelper.getInstance().delete("InvoiceStatus", "InvoiceID=?",
					new String[] { invoiceID });
		}
	}

}
